package com.jt.demo;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class Person {
    public Person(){
        System.out.println("张三出生了,资质拉满");
    }
@PostConstruct//在对象创建之后立即调用
    public void init(){
        System.out.println("张三称为少年奇才");
    }

    public void dowork(){
        System.out.println("迎娶美人鱼!!");
    }
    @PreDestroy//对象消亡时.进行调用
    public void destory(){
        System.out.println("销毁:全世界哀悼");
    }
}
